package com.linkgie.galaxyframework.httpproxy;

import java.util.LinkedHashMap;
import java.util.Map;

import com.linkgie.galaxyframework.utils.CollectionUtils;

public class HttpHeaders {

	private Map<String, HeaderEntry> headers = new LinkedHashMap<>();

	public HeaderEntry[] getAll() {
		return CollectionUtils.toArray(headers.values(), HeaderEntry.class);
	}
	
	public void set(String name, String value) {
		HeaderEntry header = new HeaderEntry(name, value);
		headers.put(name,  header);
	}
	
	public void set(HeaderEntry header) {
		headers.put(header.getName(),  header);
	}
}
